/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package telas.cadastros;

import controller.ClienteFisicoController;
import dao.GenericDAO;
import utilitarios.Bounds;
import utilitarios.Cpf;
import utilitarios.MoveTelas;
import java.sql.SQLException;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import model.LogradouroModel;
import utilitarios.Numeros;

/**
 *
 * @author WELISSON
 */
public class ClienteFisico extends javax.swing.JDialog {
    
    private GenericDAO sql;
    private MoveTelas mover;
    private Bounds bounds;
    private boolean cpfValido;
    private ClienteFisicoController cliente;
    /**
     * Creates new form ClienteFisico
     * @param parent
     * @param modal
     */
    public ClienteFisico(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        setUndecorated(true);//retira barra de titulo.
        initComponents();
        mover = new MoveTelas();
        bounds = new Bounds();
        setLocationRelativeTo(null);
        sql = new GenericDAO();
        fechar();
        bloqueiaCampos();
        cpfValido = false;
        cliente = new ClienteFisicoController();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jTNome = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jTEndereco = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTBairro = new javax.swing.JTextField();
        jTCidade = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jTUF = new javax.swing.JTextField();
        jTEmail = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jTComplemento = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jTNumero = new javax.swing.JTextField();
        jBCadastrar = new javax.swing.JButton();
        jBLimpar = new javax.swing.JButton();
        jFTCep = new javax.swing.JFormattedTextField();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jFTTelFixo = new javax.swing.JFormattedTextField();
        jFTTelCel = new javax.swing.JFormattedTextField();
        jLabel12 = new javax.swing.JLabel();
        jFTCPF = new javax.swing.JFormattedTextField();
        jLabel13 = new javax.swing.JLabel();
        jTRG = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Cadastro de Cliente Físico");
        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                formMousePressed(evt);
            }
        });
        addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                formMouseDragged(evt);
            }
        });

        jLabel1.setText("Nome:");

        jLabel2.setText("CEP:");

        jLabel3.setText("Endereco:");

        jLabel4.setText("Bairro:");

        jLabel5.setText("Cidade:");

        jLabel6.setText("UF:");

        jLabel7.setText("Email:");

        jLabel8.setText("Complemento:");

        jLabel9.setText("Numero:");

        jBCadastrar.setText("Cadastrar");
        jBCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCadastrarActionPerformed(evt);
            }
        });

        jBLimpar.setText("Limpar");
        jBLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBLimparActionPerformed(evt);
            }
        });

        try {
            jFTCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##.###-###")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jFTCep.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                preencheEndereco(evt);
            }
        });

        jLabel10.setText("Telefone Fixo:");

        jLabel11.setText("Telefone Celular:");

        try {
            jFTTelFixo.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##) ####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        try {
            jFTTelCel.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##) #####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        jLabel12.setText("CPF:");

        try {
            jFTCPF.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jFTCPF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jFTCPFKeyReleased(evt);
            }
        });

        jLabel13.setText("RG:");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTNome, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE)
                                .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGap(4, 4, 4)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jTBairro, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                                .addComponent(jTCidade, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                                .addComponent(jTUF, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                                .addComponent(jTComplemento, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                                .addComponent(jTNumero, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                                .addComponent(jTEndereco)
                                .addComponent(jFTCep)))
                        .addGroup(layout.createSequentialGroup()
                            .addGap(183, 183, 183)
                            .addComponent(jBCadastrar)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jBLimpar))
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jFTCPF)
                                .addComponent(jTEmail, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                                .addComponent(jFTTelFixo)
                                .addComponent(jFTTelCel, javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jTRG)))))
                .addGap(89, 89, 89))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(41, 41, 41)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jFTCPF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jTRG, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jTEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jFTTelFixo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jFTTelCel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jFTCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jTEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jTBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jTCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jTUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jTComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jTNumero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBCadastrar)
                    .addComponent(jBLimpar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void preencheEndereco(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_preencheEndereco
        String cep = jFTCep.getText().trim();
        if (cep.toCharArray().length == 10) {
            cep = cep.replace(".", "").replace("-", "");
            
            try {
                LogradouroModel logradouro = new ClienteFisicoController().retornaLogradouro(cep);
                if(logradouro != null){
                    jTEndereco.setText(logradouro.getEndereco());
                    jTBairro.setText(logradouro.getBairro());
                    jTCidade.setText(logradouro.getCidade());
                    jTUF.setText(logradouro.getUf());
                    jTComplemento.requestFocus();
                }else{
                    System.out.println("CEP não Encontrado");
                }
            } catch (SQLException ex) {
                ex.printStackTrace();
            }
            
        }
    }//GEN-LAST:event_preencheEndereco

    private void jBCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCadastrarActionPerformed
        String nome, cpf, rg, cep, endereco, email, complemento, numero;
        String[] tel = new String[2];
        
        nome = jTNome.getText();
        cpf = jFTCPF.getText();
        rg = jTRG.getText();
        email = jTEmail.getText();
        tel[0] = jFTTelFixo.getText().replace("(", "").replace(")", "").replace("-", "");
        tel[1] = jFTTelCel.getText().replace("(", "").replace(")", "").replace("-", "");
        cep = jFTCep.getText();
        cep = cep.replace(".", "");
        cep = cep.replace("-", "");
        endereco = jTEndereco.getText();
        
        complemento = jTComplemento.getText();
        numero = jTNumero.getText();
        if(nome.trim().equals("")){
            JOptionPane.showMessageDialog(this, "Preencha o campo Nome!");
            jTNome.requestFocus();
        }else if(cpf.trim().equals("")){
            JOptionPane.showMessageDialog(this, "Preencha o campo CPF!");
            jFTCPF.requestFocus();
        }else if(rg.trim().equals("")){
            JOptionPane.showMessageDialog(this, "Preencha o campo RG!");
            jTRG.requestFocus();
        }else if(email.trim().equals("")){
            JOptionPane.showMessageDialog(this, "Preencha o campo Email!");
            jTEmail.requestFocus();
        }else if(tel[0].trim().equals("") && tel[1].trim().equals("")){
            JOptionPane.showMessageDialog(this, "Preencha pelo menos um Campo telefone!");
            jFTTelFixo.requestFocus();
        }else if(cep.trim().equals("")){
            JOptionPane.showMessageDialog(this, "Preencha o campo Cep!");
            jFTCep.requestFocus();
        }else if(endereco.trim().equals("")){
            JOptionPane.showMessageDialog(this, "Preencha o campo Cep!");
        }else if(complemento.trim().equals("")){
            JOptionPane.showMessageDialog(this, "Preencha o campo Complemento!");
            jTComplemento.requestFocus();
        }else if(numero.trim().equals("")){
            JOptionPane.showMessageDialog(this, "Preencha o campo Numero!");
            jTNumero.requestFocus();
        }else if(!cpfValido){
            JOptionPane.showMessageDialog(this, "Informe um CPF Válido!");
        }else if(!Numeros.isNum(numero)){
            JOptionPane.showMessageDialog(this, "Campo numero só aceita numero!");
        }else{
            if(cliente.salvar(nome, cpf, rg, email, tel,cep, complemento, Integer.parseInt(numero))){
                JOptionPane.showMessageDialog(this, "Dados Cadastrados com sucesso");
                //limparCampos();
            }else{
                JOptionPane.showMessageDialog(this, "Ocorreu algum erro. Tente novamente mais tarde!");
            }
        }
    }//GEN-LAST:event_jBCadastrarActionPerformed
      
    private void jBLimparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBLimparActionPerformed
        limparCampos();
    }//GEN-LAST:event_jBLimparActionPerformed

    private void formMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMousePressed
        mover.mouseClicado(evt);
    }//GEN-LAST:event_formMousePressed

    private void formMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseDragged
        setLocation(mover.mouseMovido(evt));
    }//GEN-LAST:event_formMouseDragged

    private void jFTCPFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jFTCPFKeyReleased
        String cpf = jFTCPF.getText();
        int tamanho = cpf.toCharArray().length;
        if(tamanho == 14){
            Cpf objCpf = new Cpf();
            if(objCpf.verificaCpf(cpf)){
                cpfValido = true;
            }else{
                cpfValido = false;
            }

        }
    }//GEN-LAST:event_jFTCPFKeyReleased


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBCadastrar;
    private javax.swing.JButton jBLimpar;
    private javax.swing.JFormattedTextField jFTCPF;
    private javax.swing.JFormattedTextField jFTCep;
    private javax.swing.JFormattedTextField jFTTelCel;
    private javax.swing.JFormattedTextField jFTTelFixo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JTextField jTBairro;
    private javax.swing.JTextField jTCidade;
    private javax.swing.JTextField jTComplemento;
    private javax.swing.JTextField jTEmail;
    private javax.swing.JTextField jTEndereco;
    private javax.swing.JTextField jTNome;
    private javax.swing.JTextField jTNumero;
    private javax.swing.JTextField jTRG;
    private javax.swing.JTextField jTUF;
    // End of variables declaration//GEN-END:variables

    
  
    private void limparCampos(){
        jTNome.setText("");
        jFTCPF.setText("");
        jTRG.setText("");
        jFTTelFixo.setText("");
        jFTTelCel.setText("");
        jFTCep.setText("");
        jTEndereco.setText("");
        jTBairro.setText("");
        jTCidade.setText("");
        jTUF.setText("");
        jTEmail.setText("");
        jTComplemento.setText("");
        jTNumero.setText("");
        jTNome.requestFocus();
    }
    
    private void fechar(){ 
        JLabel fechar = bounds.botaoFechar(this.getWidth(), this);
        this.add(fechar); 
    }
    
    private void bloqueiaCampos(){
        jTEndereco.setEditable(false);
        jTBairro.setEditable(false);
        jTCidade.setEditable(false);
        jTUF.setEditable(false);
    }
    
    private void liberaCampos(){
        jTEndereco.setEditable(true);
        jTBairro.setEditable(true);
        jTCidade.setEditable(true);
        jTUF.setEditable(true);
    }
    
    
}
